<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<link href="css/base.css?v=20140102" rel="stylesheet" type="text/css" />
<title></title>
</head>
<style>

</style>
<body>
<div class="viewport" id="main_content"/>

<script type="text/javascript" src="js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="js/handlebars-v1.2.0.js"></script>

<script id="showtype_1" type="text/x-handlebars-template">
<table class="tab">
	{{#each StockList}}
    <tr>
    	<td width="1%" align="left" nowrap="nowrap">
        	<b>部门代码:</b>
        </td>
        <td align="left" >
        	{{Code}}
        </td>
        <td width="1%" align="left" nowrap="nowrap">
        	<b>部门名称:</b>
        </td>
        <td align="left" >
        	{{Name}}
        </td>
    </tr>
    <tr>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>库存数量:</b>
        </td>
        <td align="left" >
        	{{StockCount}}
        </td>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>结存金额:</b>
        </td>
        <td align="left" >
        	¥{{BalanceMoney}}
        </td>
	</tr>
	<tr><td colspan=4><div style="overflow:hidden;background:gray;height:1px;"></div></td></tr>
	{{/each}}
	
</table>
</script>

<script id="showtype_2" type="text/x-handlebars-template">
<table class="tab">
	{{#each StockList}}
    <tr>
    	<td width="1%" align="left" nowrap="nowrap">
        	<b>品牌代码:</b>
        </td>
        <td align="left" >
        	{{Code}}
        </td>
        <td width="1%" align="left" nowrap="nowrap">
        	<b>品牌名称:</b>
        </td>
        <td align="left" >
        	{{Name}}
        </td>
    </tr>
    <tr>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>库存数量:</b>
        </td>
        <td align="left" >
        	{{StockCount}}
        </td>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>结存金额:</b>
        </td>
        <td align="left" >
        	¥{{BalanceMoney}}
        </td>
	</tr>
	<tr><td colspan=4><div style="overflow:hidden;background:gray;height:1px;"></div></td></tr>
{{/each}}


</table>
</script>


<script id="showtype_3" type="text/x-handlebars-template">
<table class="tab">
	{{#each StockList}}
    <tr>
    	<td width="1%" align="left" nowrap="nowrap">
        	<b>分类代码:</b>
        </td>
        <td align="left" >
        	{{Code}}
        </td>
        <td width="1%" align="left" nowrap="nowrap">
        	<b>分类名称:</b>
        </td>
        <td align="left" >
        	{{Name}}
        </td>
    </tr>
    <tr>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>库存数量:</b>
        </td>
        <td align="left" >
        	{{StockCount}}
        </td>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>结存金额:</b>
        </td>
        <td align="left" >
        	¥{{BalanceMoney}}
        </td>
	</tr>
	<tr><td colspan=4><div style="overflow:hidden;background:gray;height:1px;"></div></td></tr>
{{/each}}
</table>


</script>


<script id="showtype_4" type="text/x-handlebars-template">
 <table class="tab">
	{{#each StockList}}
    <tr>
    	<td width="1%" align="left" nowrap="nowrap">
        	<b>商品代码:</b>
        </td>
        <td align="left" >
        	{{Code}}
        </td>
        <td width="1%" align="left" nowrap="nowrap">
        	<b>商品名称:</b>
        </td>
        <td align="left" >
        	{{Name}}
        </td>
    </tr>
    <tr>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>库存数量:</b>
        </td>
        <td align="left" >
        	{{StockCount}}
        </td>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>结存金额:</b>
        </td>
        <td align="left" >
        	¥{{BalanceMoney}}
        </td>
	</tr>
	<tr><td colspan=4><div style="overflow:hidden;background:gray;height:1px;"></div></td></tr>
{{/each}}
</table>
</script>



<script id="showtype_5" type="text/x-handlebars-template">
<table class="tab">
	{{#each StockList}}
    <tr>
    	<td width="1%" align="left" nowrap="nowrap">
        	<b>供应商代码:</b>
        </td>
        <td align="left" >
        	{{Code}}
        </td>
        <td width="1%" align="left" nowrap="nowrap">
        	<b>供应商名称:</b>
        </td>
        <td align="left" >
        	{{Name}}
        </td>
    </tr>
    <tr>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>库存数量:</b>
        </td>
        <td align="left" >
        	{{StockCount}}
        </td>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>结存金额:</b>
        </td>
        <td align="left" >
        	¥{{BalanceMoney}}
        </td>
	</tr>
	<tr><td colspan=4><div style="overflow:hidden;background:gray;height:1px;"></div></td></tr>
{{/each}}
</table>

</script>


<script type="text/javascript">

	   var showtype=window.android.showtype();
	   var source=null;
	   var context = null;

	   if ('1'==showtype){
	      source=$("#showtype_1").html();
		  //context={"StockList":[{"Code":"010101","Name":"测试部门","StockCount":100,"BalanceMoney":20000}],"Result":"1","Message":""};
	   }
	   if ('2'==showtype){
	      source=$("#showtype_2").html();
		  //context={"StockList":[{"Code":"123","Name":"某品牌","StockCount":100,"BalanceMoney":20000 }],"Result":"1","Message":""};
	   }
	   if ('3'==showtype){
	      source=$("#showtype_3").html();
		  //context={"StockList":[{"Code":"010101","Name":"某分类","StockCount":100,"BalanceMoney":20000}],"Result":"1","Message":""};
	   }
	   if ('4'==showtype){
	      source=$("#showtype_4").html();
		 //context={"StockList":[{"Code":"018743","Name":"某商品","StockCount":100,"BalanceMoney":20000,"GoodsSpec":"商品的货号"}],"Result":"1","Message":""};
	   }
	   if ('5'==showtype){
	   	 source=$("#showtype_5").html();
	   	 //context={"StockList":[{"Code":"0000001","Name":"某供应商","StockCount":100,"BalanceMoney":20000}],"Result":"1","Message":""};
	   }
	   
	   
      var template = Handlebars.compile(source);

	  eval( ' context=' + window.android.getjson() );
	
	   window.android.hidepdg();
	
	  if (context.Result == 0 ){
		   alert( context.Message );
	  }else{
		  var html = template( context );
	       $("#main_content").html( html );
	  }
</script>

</body>
</html>
